home *** CD-ROM | disk | FTP | other *** search
/ HTBasic 9.3 / HTBasic 9.3.iso / SICL / data1.cab / sicl32 / vb / samples / misc / errhand.bas next >
Encoding:
BASIC Source File  |  2001-03-02  |  584 b   |  28 lines

  1.  
  2. '  errhand.bas
  3. Sub Main ()
  4.    Dim dvm As Integer
  5.    Dim res As Double
  6.  
  7.    On Error GoTo ErrorHandler
  8.  
  9.    dvm = iopen("hpib7,16")
  10.    Call itimeout(dvm, 10000)
  11.    argcount = ivprintf(dvm, "MEAS:VOLT:DC?" + Chr$(10))
  12.    argcount = ivscanf(dvm, "%lf", res)
  13.    MsgBox "Result is " + Format(res)
  14.    iclose (dvm)
  15.  
  16.    ' Tell SICL to cleanup for this task
  17.    Call siclcleanup
  18.    End
  19.  
  20. ErrorHandler:
  21.    '  Display the error message
  22.       MsgBox "*** Error : " + Error$, MB_ICON_EXCLAMATION
  23.    '  Tell SICL to cleanup for this task
  24.    Call siclcleanup
  25.    End
  26. End Sub
  27.  
  28.